Skip to content

Add zstd to makefile routing#1802

Open
reshke wants to merge 1 commit into
apache:mainfrom
reshke:make
Open

Add zstd to makefile routing#1802
reshke wants to merge 1 commit into
apache:mainfrom
reshke:make

Conversation

@reshke
Copy link
Copy Markdown
Contributor

@reshke reshke commented Jun 3, 2026

How does it even work without this?

Comment thread gpcontrib/Makefile
@if [ "$(enable_orafce)" = "yes" ]; then \
$(MAKE) -C orafce NO_PGXS=true install; \
fi
@if [ "$(with_zstd)" = "yes" ]; then \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @reshke thanks for the patch!

▎ How does it even work without this?

It works through the recurse mechanism that's already in place. A few lines above in the same Makefile:

ifeq "$(with_zstd)" "yes"
recurse_targets += zstd
endif
...
$(call recurse,all install clean distclean, $(recurse_targets))

The recurse function (defined in src/Makefile.global.in) uses $(eval) to generate, for each target/subdir pair:

install: install-zstd-recurse
install-zstd-recurse: submake-generated-headers
$(MAKE) -C zstd install

Since GNU make allows adding prerequisites to a target whose recipe is defined elsewhere, the explicit install: recipe below picks up
install-zstd-recurse as a prerequisite — so make install already descends into zstd/ before running the gpcloud/mapreduce/pxf/orafce steps. Same for
all, clean, and distclean.

This is easy to verify with a dry run:

$ make -n -C gpcontrib install | grep "zstd install"
make -C zstd install

With this patch applied, make -C zstd install (and clean) would run twice — harmless, but redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants